<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>${sysName}</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="${resRoot}/layui/css/layui.css" media="all" />
  <link rel="stylesheet" href="${resRoot}/layui/admin/admin.css" media="all" />
	<link id="layuicss-layer" rel="stylesheet" href="${resRoot}/layui/css/modules/layer/default/layer.css" media="all">
</head>
<body>
<div class="layui-fluid">   
          <div class="layui-card">
          <div class="layui-form layui-card-header layuiadmin-card-header-auto"> 
 
<form class="layui-form" action="#" style="margin-top: 20px;margin-bottom:50px;" lay-filter="dataForm"  >
<input type="hidden" id="id" name="id"  >
  <div class="layui-form-item">
    <label class="layui-form-label">机构名称</label>
    <div class="layui-input-inline">
	      <input type="text" name="jgName" id="jgName" value=""  autocomplete="off" placeholder="请输入机构名称" class="layui-input" lay-verify="required" lay-reqtext="请输入机构名称" >
    </div>
    <div class="layui-form-mid layui-word-aux">请输入机构名称</div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">服务类型</label>
    <div class="layui-input-inline">
	      <input type="text" name="fwlx" id="fwlx" value=""  autocomplete="off" placeholder="请输入服务类型" class="layui-input" lay-verify="required" lay-reqtext="请输入服务类型" >
    </div>
    <div class="layui-form-mid layui-word-aux">请输入服务类型</div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">服务方式</label>
    <div class="layui-input-inline">
	      <input type="text" name="fwfs" id="fwfs" value=""  autocomplete="off" placeholder="请输入服务方式" class="layui-input" lay-verify="required" lay-reqtext="请输入服务方式" >
    </div>
    <div class="layui-form-mid layui-word-aux">请输入服务方式</div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">可接纳人数</label>
    <div class="layui-input-inline">
	      <input type="text" name="kjnrs" id="kjnrs" value=""  autocomplete="off" placeholder="请输入可接纳人数" class="layui-input" lay-verify="required" lay-reqtext="请输入可接纳人数" >
    </div>
    <div class="layui-form-mid layui-word-aux">请输入可接纳人数</div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">当前服务人数</label>
    <div class="layui-input-inline">
	      <input type="text" name="dqfwrs" id="dqfwrs" value=""  autocomplete="off" placeholder="请输入当前服务人数" class="layui-input" lay-verify="required" lay-reqtext="请输入当前服务人数" >
    </div>
    <div class="layui-form-mid layui-word-aux">请输入当前服务人数</div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">单位地址</label>
    <div class="layui-input-inline">
	      <input type="text" name="address" id="address" value=""  autocomplete="off" placeholder="请输入单位地址" class="layui-input" lay-verify="required" lay-reqtext="请输入单位地址" >
    </div>
    <div class="layui-form-mid layui-word-aux">请输入单位地址</div>
  </div>

<div class="layui-form-item">
    <label class="layui-form-label">开办时间</label>
    <div class="layui-input-inline">
    	<input type="text" class="layui-input" id="kbsj" name="kbsj"  onClick="WdatePicker({startDate:'%y-%M-%d 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true});" placeholder="yyyy-MM-dd HH:mm:ss" value="" lay-verify="required" >
    </div>
    <div class="layui-form-mid layui-word-aux">请选择开办时间</div>
  </div>


  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" id=""  lay-submit="" lay-filter="dataSaveSubmit"  type="button">立即提交</button>
      <button type="button" class="layui-btn layui-btn-primary" onclick="backList();" >返回</button>
    </div>
  </div>
</form>
</div>
  </div>
  </div>
<#include "/page/footer.html">
<script>
var id = "${id!}";
$(function(){


$(function(){
	var dataTmp = getDataById(id, "${base}/sys/clKfjgInfo/get/" + id)
})
});
function backList() {
	parent.layer.closeAll("iframe");
    //刷新父页面
    parent.location.reload();
}

function removeImg(id) {
	layer.confirm('您是确认删除/查看该图片吗？', {
		  btn: ['确认','查看'] //按钮
		}, function(){
			$("#" + id).attr("src", "");
			layer.msg('已删除！');
		}, function(){
			window.open($("#" + id).attr("src"));
		  //layer.msg('已取消！');
		});
}
layui.use(['form', 'layedit', 'laydate', 'upload'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate;
  
  
  var upload = layui.upload;
  
  // 页面验证，及自定义验证规则 样例 表单验证参考  https://www.layui.com/demo/form.html
  form.verify({
    title: function(value){
      if(value.length == 0){
        return '参数不能为空';
      }
    }
    ,pass: [/(.+){6,12}$/, '密码必须6到12位']
    ,content: function(value){
      layedit.sync(editIndex);
    }
  });
  
  
  form.on('submit(dataSaveSubmit)', function(data){
      var index = layer.msg('加载中...',{icon: 16,time:false,shade:0.8});
      delete data.field.file;
      $.ajax({
			url : "${base}/sys/clKfjgInfo/save",
			contentType : "application/json",
         	dataType : 'json',
			data : JSON.stringify(data.field),
          	type:'post',
			async : true,
			success : function(data) {
				layer.close(index);
				console.log(data)
				if(data.code == 1) {
						layer.msg('保存成功！', {
						  icon: 1,
						  time: 2000 //2秒关闭（如果不配置，默认是3秒）
						}, function(){
							backList();
						});   
					} else {
						layer.msg(data.msg); 
					}
			}
		}); 
    });
  
});

layui.use('upload', function(){
	  
});  
</script>
</body>
</html>